""" 部署在阿里云机器上， 开放给 工厂内运行的 Data Collection Server 来 定时 push 到 postgresql """

from sanic import Sanic
from sanic.response import json
import json as JSON
import logging
_logger = logging.getLogger(__name__)

app = Sanic()


@app.post('/dcs/upload/spindle_status')
async def spindle_status(request):
    """ 测试用： 部署在 """

    data = JSON.loads(request.json)
    _logger.info(data)

    return json( {'code': 200, 'msg':'ok'} )


if __name__ == '__main__':
    app.run(host='127.0.0.1', port=3000)